package com.yeqian.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yeqian.user.entity.Permission;
import com.yeqian.user.mapper.PermissionMapper;
import com.yeqian.user.service.PermissionService;
import com.yeqian.vo.PageVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PermissionServiceImpl  extends ServiceImpl<PermissionMapper, Permission> implements PermissionService {

    @Resource
    private PermissionMapper permissionMapper;
    @Override
    public PageInfo<Permission> listpermission(PageVO pageVO) {
        PageHelper.startPage(pageVO.getPageNum(), pageVO.getPageSize());
        QueryWrapper<Permission> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("deleteflag","0");
        queryWrapper.orderByAsc("porder");
        List<Permission> permissionList = permissionMapper.selectList(queryWrapper);
        return PageInfo.of(permissionList);
    }
}
